Add comprehensive macOS support with platform abstraction#14
Merged
Conversation
This commit adds full macOS support to RustCat while maintaining Windows compatibility through a clean platform abstraction layer. ## Key Features Added: ### macOS Platform Support - Full macOS system integration with NSApplication - Activity Monitor integration (equivalent to Windows Task Manager) - macOS theme detection and settings persistence via defaults - LaunchAgent integration for startup behavior - Native macOS CPU usage monitoring via Mach kernel APIs ### Platform Abstraction Layer - Created comprehensive trait-based platform abstraction in `src/platform/` - Abstracted CPU monitoring, settings management, and system integration - Eliminated code duplication between Windows and macOS implementations - Simplified CPU usage calculation to return percentage directly ### CI/CD Improvements - Added universal macOS app bundle creation (Intel + Apple Silicon) - Automated DMG creation for professional macOS distribution - App icon generation from existing assets - Multi-architecture build support with proper artifact management - Universal binaries provide optimal performance on both Intel and Apple Silicon ### Code Organization - Removed obsolete files (`main_macos.rs`, `windows_api.rs`, `cpu_usage.rs`, `settings.rs`) - Consolidated platform-specific code into organized modules - Simplified event handling and menu system - Removed mnemonic support for cleaner cross-platform menus ### Distribution Improvements - Windows: `rust_cat.exe` binary - macOS: Universal DMG with drag-and-drop installation - Proper app bundle structure with Info.plist and app icon - Simplified distribution with single universal binary for macOS This architecture makes adding new platforms straightforward while maintaining clean separation of concerns and optimal performance across all supported systems. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
## Changes ### 🛠️ macOS Build Script (`build_macos.sh`) - Complete automation of macOS build process - Multi-architecture support (Intel + Apple Silicon) - Universal binary creation with `lipo` - App bundle creation with proper structure - DMG generation for professional distribution - Icon creation from existing assets - Verbose output with progress indicators ### 🚀 Simplified CI Workflow - Removed complex matrix strategy for single Windows target - Replaced complex universal build logic with simple script call - Cleaner job names: `build-windows` and `build-macos` - Reduced YAML complexity from ~80 to ~40 lines - Better maintainability and local testing support ### 📁 Updated .gitignore - Added comprehensive macOS build artifact exclusions - Covers app bundles, DMG files, universal binaries - Excludes system files like .DS_Store - Prevents accidental commit of build outputs The build process is now much simpler to understand and maintain, with all macOS-specific logic contained in a reusable shell script. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused PlatformSettingsManager import from app.rs - Remove unused shutdown method from WindowsApp - Fix return type conflicts with windows crate's Result type - Fix string error conversion in MessageBoxW failure handling - Remove wildcard imports in system_integration.rs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds complete macOS support to RustCat while maintaining Windows compatibility through a clean platform abstraction layer.
Key Features Added
🍎 macOS Platform Support
defaults🏗️ Platform Abstraction Layer
src/platform/🚀 CI/CD Improvements
📁 Code Organization
main_macos.rs,windows_api.rs,cpu_usage.rs,settings.rs)📦 Distribution Improvements
rust_cat.exebinaryTest plan
This architecture makes adding new platforms straightforward while maintaining clean separation of concerns and optimal performance across all supported systems.
🤖 Generated with Claude Code